var express = require("express");
var router = require("./controller");
var app = express();
var bodyParser = require("body-parser");

app.set("view engine","ejs");
app.use(express.static("./public"));
app.use(express.static("./uploads"));
app.use(bodyParser.urlencoded({ extended: false }));



app.get("/",router.showIndex);
app.get("/up",router.showUp);
app.get("/newdir",router.newDirectory);
app.get("/manadir",router.managementDir);


app.post("/renameup",router.renameDir);
app.post("/deleteup",router.deleteDir);
app.post("/newup",router.newPost);
app.post("/up",router.doPost);

app.get("/:albumName",router.showAlabums);
app.use(function(req,res){
    res.render("404",{
        "baseurl" : req.pathname
    });
})
app.listen(3000);
